
<script>
    var haveData                    =   true;
	$(function(){
        $('.lazy').lazyload();
        $(window).scroll(function () {
            if ($(window).scrollTop() == $(document).height() - $(window).height()) {
                nextPage();
            }
        });
		$(".goods-list li").hover(
 				function(){
 				   //当鼠标放上去的时候,程序处理
 				   $(this).addClass("hover1 hover");
 				},
 				function(){
 				   //当鼠标离开的时候,程序处理
 				   $(this).removeClass("hover1 hover");
 				});
 		
 		$('.article-list').find('li').hover(
				function(){
					$(this).css('box-shadow','0px 2px 8px 3px #ccc');
				},
				function(){
					$(this).css('box-shadow','');
				}
			
		);
 		$('#header-search').click(function(){
 			var search = $('.navbar-search');
 			if(search.css('display')=='block'){
 				$('.big-bg').hide();
 	 			$('.navbar-search').hide();
 			}else{
 				$('.navbar-search').show();
 	 			$('.big-bg').show();
 			}
 			
 		});
 		$('.big-bg').click(function(){
 			$('.big-bg').hide();
 			$('.navbar-search').hide();
 		});
 		$('.glyphicon-heart').click(function(){
			 id = $(this).attr('data-id');
			 that = $(this);
			 $.get("{:U('Article/favor')}",{'id':id},function(json){
	            showMessage(json.info);
	            if(json.status == 1){
	            	that.css('color','red');	
	            }else{
	            	that.css('color','red');	
	            }
	  	  	});  
		});
 		$('.icon-like').click(function(){
			 id = $(this).attr('data-id');
			 that = $(this);
			 $.get("{:U('Article/favor')}",{'id':id},function(json){
	            showMessage(json.info);
	            if(json.status == 1){
	            	that.addClass('like');	
	            }else{
	            	that.removeClass('like');	
	            }
	  	  	});  
		});
		
	});

function favor(goodsid){
    $.get("{:U('ajax/favor')}",{id:goodsid},function(json){
            showMessage(json.info);
    })    
}    
function showMessage(msg){
    Lobibox.notify('error', {
        showClass: 'bounceIn',
        hideClass: 'bounceOut',
        msg: msg,
        soundPath: '__STATIC__/lobibox/sounds/'
    });
    console.log(msg);
}
function heightlight_bottom_nav(url){
	
	$('.bottom-menu').find('a[href^="'+url+'"]').closest('div').addClass('active');  	
}
</script>
<block name="script">
</block>



